package easy

import (
	"fmt"
	"sort"
)

func FindRelativeRanks(score []int) []string {
	n := len(score)
	desc := []string{"Gold Medal", "Silver Medal", "Bronze Medal"}
	arr := make([][2]int, n)
	for i := 0; i < n; i++ {
		arr[i][0] = score[i]
		arr[i][1] = i
	}
	sort.Slice(arr, func(i, j int) bool {
		return arr[i][0] > arr[j][0]
	})
	ans := make([]string, n)
	for i := 0; i < n; i++ {
		if i >= 3 {
			ans[arr[i][1]] = fmt.Sprintf("%d", i+1)
		} else {
			ans[arr[i][1]] = desc[i]
		}
	}
	return ans
}
